<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>万德众归俱乐部后台管理</title>
    <link type="text/css" rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link th:href="@{/plugins/font-awesome/css/font-awesome.css}" rel="stylesheet" />
    <link th:href="@{/plugins/sideshow/css/normalize.css}" rel="stylesheet" />
    <link th:href="@{/builds/css/themes/default.css}" rel="stylesheet" />
    <link th:href="@{/builds/css/app.css}" rel="stylesheet" />
    <link th:href="@{/bootstraps/css/bootstrap.css}" rel="stylesheet" />
    <style>
        body{
            <!-- 去掉横向的条条 -->
            overflow-y: scroll;
        }
        .labels{
			margin: 0px;
		}
		.quote{
			padding:10px;
			 font-size: 14px; 
		}
    </style>
</head>
<body style="padding-top:10px">
	<blockquote class="demoTable layui-elem-quote quote" style="padding:10px 10px;border:0px">
		 <div  class="layui-form layui-form-pane">
	        <div class="layui-inline">
	           <label class="layui-form-label labels">查询条件</label>
	          <div class="layui-input-inline">
	            <input type="text" id="searchtext" value="" lay-verify="" placeholder="请输入查询条件" autocomplete="off" class="layui-input">
	          </div>
	        </div>
	          <button class="layui-btn layui-btn-sm" data-type="serach">搜索</button>
	          <shiro:hasPermission name="${modular?uncap_first}:${modelName?uncap_first}:add">
					<button class="layui-btn layui-btn-sm" data-type="add${className}">新增</button>
			  </shiro:hasPermission>
         </div>
	</blockquote>
    <table class="layui-table" lay-data="{height: 'full', cellMinWidth: 80, limit:15,limits:[15,30], url:'/${visitUrl}/get${className}List',page:{elem:'test',curr: location.hash.replace('#!fenye=', ''),hash: 'fenye'}, id:'test'}" lay-filter="test" id="test">
        <thead>
            <tr>
                <th lay-data="{type:'checkbox'}">ID</th>
            <#list gridList as column>
                <th lay-data="{field:'${column.name}', sort: true,align:'center'}">${column.label}</th>
            </#list>
                <th lay-data="{fixed: 'right', align:'center', toolbar: '#barDemo'}">操作</th>
            </tr>
        </thead>
    </table>

    <!-- 新增界面 -->
    <div class="modal fade" id="add${className}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width:30%">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">新增${title}</h4>
                </div>
                <form class="form-horizontal" action="/${visitUrl}/add${className}" method="post" id="add${className}Form" style="margin-top:10px;">
                    <#list gridList as column>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">${column.label}:</label>
                        <div class="col-sm-6">
                            <input type="text" id="${column.name}" name="${column.name}" placeholder="${column.label}" class="form-control" required="required" value=""/>
                        </div>
                    </div>
                    </#list>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="submit" id="tijiao" class="btn btn-primary">提交 </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <!-- 修改界面 -->
    <div class="modal fade" id="update${className}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width:30%">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">修改${title}</h4>
                </div>
                <form class="form-horizontal" action="/${visitUrl}/add${className}" method="post" id="update${className}Form" style="margin-top:10px;">
                	<input id="id" name="id" type="hidden"/>
                	<#list gridList as column>
                    <div class="form-group">
                        <label class="col-sm-4 control-label">${column.label}:</label>
                        <div class="col-sm-6">
                            <input type="text" id="update${column.name}" name="${column.name}" placeholder="${column.label}" class="form-control" required="required" value=""/>
                        </div>
                    </div>
                    </#list>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="submit" id="tijiao" class="btn btn-primary">提交 </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script type="text/javascript" th:src="@{/layui/layui.js}"></script>
    <script type="text/javascript" th:src="@{/js/${modular}.${modelName}/${modelName}.js}"></script>
    <script type="text/javascript" th:src="@{/bootstraps/js/jquery-3.2.1.min.js}"></script>
    <script type="text/javascript" th:src="@{/bootstraps/js/bootstrap.js}"></script>
    <script type="text/html" id="barDemo">
		 <shiro:hasPermission name="${modular?uncap_first}:${modelName?uncap_first}:edit">
        	<a class="layui-btn layui-btn-sm" lay-event="edit">编辑</a>
		 </shiro:hasPermission>
		 <shiro:hasPermission name="${modular?uncap_first}:${modelName?uncap_first}:delete">
        	<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
		 </shiro:hasPermission>
    </script>
</body>
</html>